import com.air.DemoRun;
import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.HashMap;
import java.util.Map;

/**
 * @author shent
 */
@SpringBootTest(classes = DemoRun.class)
public class Mq {

    @Autowired
    RabbitTemplate rabbitTemplate;

    @Test
    public void testFanout() {
        Map<String, String> map = new HashMap<>();
        map.put("id", "123");
        rabbitTemplate.convertAndSend("fanoutExchange", null, map);
    }

}
